<template>
  <div class="searchDiv" :style="'width: ' + width + 'px'">
    <!-- <div class="optionsDiv">
      <img src="../assets/image/help/search.png" alt="" />
      <el-input
        v-model.trim="quickSearch"
        class="search-box"
        :placeholder="tip"
        clearable
        @keyup.enter.native="search"
      ></el-input>
      <div id="searchBtn" @click="search">搜 索</div>
    </div> -->
    <div class="optionsDiv2">
      <el-input
        v-model.trim="quickSearch"
        class="search-box2"
        :placeholder="tip"
        clearable
        @keyup.enter.native="search"
      ></el-input>
      <div class="searchBtn2" @click="search">搜 索</div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    width: {
      type: Number,
      default: 600,
    },
    tip: {
      type: String,
      default: '搜索内容'
    }
  },
  data() {
    return {
      quickSearch: "", //搜索内容
    };
  },
  methods: {
    // 点击搜索
    search() {
      this.$emit("search", this.quickSearch);
    },
  },
};
</script>

<style lang="scss" scoped>
.searchDiv {
  border: 1px solid #e1e1e1;
  margin: 18px auto;
}

.searchDiv .optionsDiv {
  text-align: left;
  padding: 6px 20px;
  font-size: 15px;
  color: #676767;
  display: flex;
  justify-content: left;
  align-items: center;
}

.searchDiv .optionsDiv img {
  width: 18px;
  height: 18px;
}

.searchDiv .optionsDiv .search-box {
  flex: 1;
}

>>> .optionsDiv .search-box.el-input .el-input__inner {
  border: none !important;
}

#searchBtn {
  background-color: #d00000;
  color: #ffffff;
  height: 32px;
  width: 91px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 4px;
}

#searchBtn:hover {
  cursor: pointer;
}

::v-deep .optionsDiv2 .search-box2.el-input .el-input__inner {
  border: none !important;
}
.optionsDiv2 {
  display: flex;
  height: 52px;
  .search-box2 {
    flex: 1;
    text-align: left;
    padding: 6px;
    font-size: 15px;
    color: #676767;
  }
  .searchBtn2 {
    background-color: rgba(241,56,56,1);
    color: #ffffff;
    width: 91px;
    height: 100%;
    line-height: 52px;
    cursor: pointer;
    text-align: center;
  }
}
</style>